<div class="content-nav">
	<div class="inner-box sidebar-toc-wrapper" style="">
		<h5 class="contents">Contents</h5>
		<div class="inner-toc" id="sidebar-toc">

      <ul>
        {% assign sorted = site.tour | sort: 'num' %}
        {% for pg in sorted %}
          {% if pg.num and (page.partof == pg.partof) %}
            {% if page.language %}
              {% assign prefix = page.language | prepend: '/' %}
              {% assign localizedId = pg.id | prepend: prefix %}
              {% for lpg in site.[page.language] %}
                {% if lpg.id == localizedId %}
                  <li><a {% if page.title == lpg.title %}class="active"{% endif %} href="/{{ site.baseurl }}{{ page.language }}{{ pg.url }}">{{ lpg.title }}</a></li>
                {% endif %}
              {% endfor %}
            {% else %}
            <li><a {% if pg.title == page.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
            {% endif %}
          {% endif %}
        {% endfor %}
      </ul>

      {% if page.language %}
        {% assign engPath = page.id | remove_first: "/" | remove_first: page.language | append: '.html' %}
        <ul id="available-languages" style="display: none;">
          <li><a href="{{ site.baseurl }}{{ engPath }}">English</a></li>
          {% for l in site.data.translations.tour.languages %}
            {% assign lang = site.data.languages[l] %}
            <li><a href="{{ site.baseurl }}/{{ l }}{{ engPath }}" class="lang">{{ lang.name }}</a></li>
          {% endfor %}
        </ul>
      {% elsif site.data.translations.tour.languages != empty  %}
        <ul id="available-languages" style="display: none;">
          <li><a href="{{ site.baseurl }}{{ page.url }}">English</a></li>
          {% for l in site.data.translations.tour.languages %}
            {% capture rootTutorialURL %}{{ page.url | remove_first: '/' }}{% endcapture %}
            {% assign lang = site.data.languages[l] %}
            <li><a href="{{ site.baseurl }}/{{ l }}/{{ rootTutorialURL }}" class="lang">{{ lang.name }}</a></li>
          {% endfor %}
        </ul>
      {% endif %}
		</div>
		<hr>
		<div class="help-us"><a href="https://github.com/scala/docs.scala-lang/blob/master/{% if page.collection %}{{ page.relative_path }}{% else %}{{ page.path }}{% endif %}"><i class="fa fa-pencil" aria-hidden="true"></i> Problem with this page?<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please help us fix it!</a></div>
	</div>
</div>
